<admintpl file="headerEx" />
<title>{:L('ADMIN_SLIDE_INDEX')}</title>

<!--responsive table-->
<link href="__PUBLIC__/TciocEx/css/table-responsive.css" rel="stylesheet" />
</head>

<!-- Placed js at the end of the document so the pages load faster -->
<body class="sticky-header">
<section>
	<!-- main content start-->
	<div class="full-content" >
		<!--body wrapper start-->
		<div class="wrapper ">
			<div class="row">
				<div class="col-sm-12">
					<section class="panel">
						<header class="panel-heading custom-tab turquoise-tab">
							<ul class="nav nav-tabs">
								<li class="active"><a href="{:U('slide/index')}"><i class="fa fa-list-ul"></i> {:L('ADMIN_SLIDE_INDEX')}</a></li>
								<li><a href="{:U('slide/add')}"><i class="fa fa-plus"></i> {:L('ADMIN_SLIDE_ADD')}</a></li>
							</ul>
						</header>
						<div class="panel-body">
							<section class="panel">
								<div class="panel-body">
									<form class="well form-search form-horizontal" method="post" id="cid-form">
										<select class="input-lg" name="cid" style="width: 100px;" id="selected-cid">
											<option value=''>{:L('ALL')}</option>
											<foreach name="categorys" item="vo">
												<php>$cid_select=$vo['cid']===$slide_cid?"selected":"";</php>
												<option value="{$vo.cid}"{$cid_select}>{$vo.cat_name}</option>
											</foreach>
										</select>
									</form>
								</div>
							</section>
							<section class="panel">
							<form class="js-ajax-form" method="post" >
								<div class="btn-group m-bot15">
									<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('slide/listorders')}">{:L('SORT')}</button>
									<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('slide/toggle',array('display'=>1))}" data-subcheck="true">{:L('DISPLAY')}</button>
									<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('slide/toggle',array('hide'=>1))}" data-subcheck="true">{:L('HIDDEN')}</button>
									<button class="btn btn-danger btn-small js-ajax-submit" type="submit" data-action="{:U('slide/delete')}" data-subcheck="true" data-msg="你确定删除吗？">{:L('DELETE')}</button>
								</div>
								<php> $status=array("1"=>L('DISPLAY'),"0"=>L('HIDDEN')); </php>
								<section id="no-more-tables">
									<table class="table table-bordered table-striped table-hover table-condensed cf" id="menus-table">
										<thead>
										<tr>
											<th width="15"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
											<th width="50">{:L('SORT')}</th>
											<th >ID</th>
											<th width="30%">{:L('TITLE')}</th>
											<th width="20%">{:L('DESCRIPTION')}</th>
											<th width="20%">{:L('LINK')}</th>
											<th>{:L('IMAGE')}</th>
											<th >{:L('STATUS')}</th>
											<th>{:L('ACTIONS')}</th>
										</tr>
										</thead>
										<foreach name="slides" item="vo">
											<tr>
												<td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$vo.slide_id}"></td>
												<td><input  style="border-radius: 6px;text-align: center" name='listorders[{$vo.slide_id}]' class="input input-order mr5" type='text' size='3' value='{$vo.listorder}'></td>
												<td>{$vo.slide_id}</td>
												<td>{$vo.slide_name}</td>
												<td>{$slide_des = mb_substr($vo['slide_des'], 0, 48,'utf-8')}</td>
												<td>{$vo.slide_url}</td>
												<td>
													<if condition="!empty($vo['slide_pic'])">
														<a href="{:sp_get_image_preview_url($vo['slide_pic'])}" target="_blank">{:L('VIEW')}</a>
													</if>
												</td>
												<td>{$status[$vo['slide_status']]}</td>
												<td>
													<a href="{:U('slide/edit',array('id'=>$vo['slide_id']))}">{:L('EDIT')}</a>
													<a href="{:U('slide/delete',array('id'=>$vo['slide_id']))}" class="js-ajax-delete">{:L('DELETE')}</a>
													<if condition="empty($vo['slide_status']) eq 1">
														<a href="{:U('slide/cancelban',array('id'=>$vo['slide_id']))}" class="js-ajax-dialog-btn" data-msg="确定显示此幻灯片吗？">{:L('DISPLAY')}</a>
														<else />
														<a href="{:U('slide/ban',array('id'=>$vo['slide_id']))}" class="js-ajax-dialog-btn" data-msg="确定隐藏此幻灯片吗？">{:L('HIDE')}</a>
													</if>
												</td>
											</tr>
										</foreach>
										<tfoot>
										<tr>
											<th width="15"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
											<th >{:L('SORT')}</th>
											<th >ID</th>
											<th >{:L('TITLE')}</th>
											<th >{:L('DESCRIPTION')}</th>
											<th >{:L('LINK')}</th>
											<th >{:L('IMAGE')}</th>
											<th >{:L('STATUS')}</th>
											<th >{:L('ACTIONS')}</th>
										</tr>
										</tfoot>
									</table>
								</section>
								<div class="btn-group m-bot15">
									<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('slide/listorders')}">{:L('SORT')}</button>
									<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('slide/toggle',array('display'=>1))}" data-subcheck="true">{:L('DISPLAY')}</button>
									<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('slide/toggle',array('hide'=>1))}" data-subcheck="true">{:L('HIDDEN')}</button>
									<button class="btn btn-danger btn-small js-ajax-submit" type="submit" data-action="{:U('slide/delete')}" data-subcheck="true" data-msg="你确定删除吗？">{:L('DELETE')}</button>
								</div>
							</form>
								</section>
						</div>
					</section>
				</div>
			</div>
		</div>

	</div>
	</div>
	</div>
	<!--body wrapper end-->

	<!--footer section start-->
	<footer>
		<admintpl file="copyright" />
	</footer>
	<!--footer section end-->

	</div>
	<!-- main content end-->
</section>



<script src="__PUBLIC__/TciocEx/js/jquery-1.10.2.min.js"></script>
<script src="__PUBLIC__/js/wind.js"></script>
<script src="__PUBLIC__/js/common.js"></script>
<script src="__PUBLIC__/TciocEx/js/jquery-ui-1.9.2.custom.min.js"></script>
<script src="__PUBLIC__/simpleboot/bootstrap/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/jquery-migrate-1.2.1.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/modernizr.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/jquery.nicescroll.js"></script>
<script src="__PUBLIC__/js/ajaxForm.js"></script>

<script type="text/javascript" src="__PUBLIC__/TciocEx/js/jquery.validate.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/validation-localization/messages_zh.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/scripts.js"></script>
<script src="__PUBLIC__/TciocEx/js/validation-init.js"></script>
<script>
	setCookie('refersh_time', 0);
	function refersh_window() {
		var refersh_time = getCookie('refersh_time');
		if (refersh_time == 1) {
			window.location.reload();
		}
	}
	setInterval(function() {
		refersh_window()
	}, 3000);
	$(function() {
		$("#selected-cid").change(function() {
			$("#cid-form").submit();
		});
	});
</script>
</body>
</html>